/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package miage.rest.validation;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author marya
 */
public class NotEmptyValidator extends AbstractValidator{

        
        public NotEmptyValidator() {
            super();
        }


        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            return true;
        }





        public boolean isValid(String data){
            boolean result = true;
            if(data == null){
               addMessage("Exception occured : null data");
               result = false;
            }
            if(data.trim().isEmpty()){
                addMessage("Exception occured : empty data");
                result = false;
            }
            return result;
        }

}
